-
Notifications
You must be signed in to change notification settings - Fork 2
feat: support consumer translator #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
15a1333 to
38558c3
Compare
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-04-03T03:47:45Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: API7
project: api7-ingress-controller
url: https://github.com/api7/api7-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
failedTests:
- HTTPRouteCrossNamespace
- HTTPRoutePathMatchOrder
result: failure
skippedTests:
- GatewayInvalidTLSConfiguration
- GatewaySecretInvalidReferenceGrant
- GatewaySecretMissingReferenceGrant
- GatewaySecretReferenceGrantAllInNamespace
- GatewaySecretReferenceGrantSpecific
- HTTPRouteExactPathMatching
- HTTPRouteHTTPSListener
- HTTPRouteHeaderMatching
- HTTPRouteHostnameIntersection
- HTTPRouteInvalidBackendRefUnknownKind
- HTTPRouteInvalidCrossNamespaceBackendRef
- HTTPRouteInvalidCrossNamespaceParentRef
- HTTPRouteInvalidNonExistentBackendRef
- HTTPRouteInvalidParentRefNotMatchingSectionName
- HTTPRouteInvalidReferenceGrant
- HTTPRouteListenerHostnameMatching
- HTTPRouteMatching
- HTTPRouteMatchingAcrossRoutes
- HTTPRoutePartiallyInvalidViaInvalidReferenceGrant
- HTTPRouteReferenceGrant
- HTTPRouteRequestHeaderModifier
- HTTPRouteWeight
statistics:
Failed: 2
Passed: 9
Skipped: 22
name: GATEWAY-HTTP
summary: Core tests failed with 2 test failures. |
| spec: | ||
| gatewayRef: | ||
| name: api7ee | ||
| plugins: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admin api 是可以的。我测过,ingress 模式可以启用,那个是 dashboard 拦截,后端并没有拦截,ingress 有拦截的必要吗?而且考虑还要对接 apisix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的测试下个 PR 会删掉,这是不推荐的用法。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for consumer translation, enhancing the API7 Ingress Controller by incorporating consumer-related functionality into ADC translation and associated e2e tests.
- New e2e tests and CRDs for Consumer resources
- Integration of consumer credentials and plugins in ADC translation
- Updates to consumer controller indexing and reconciliation for improved status management
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/scaffold/k8s.go | Added helper to apply resource changes in tests |
| test/e2e/e2e_test.go | Updated test imports to include consumer CRDs |
| test/e2e/crds/consumer.go | Introduced e2e tests for Consumer and Credential support |
| internal/provider/provider.go | Extended translation context to include credentials |
| internal/provider/adc/translator/translator.go | Added Consumers field to translation result |
| internal/provider/adc/translator/consumer.go | Implemented Consumer translation for ADC |
| internal/provider/adc/adc.go | Integrated consumer support in ADC update and delete workflows |
| internal/controller/status.go | Introduced status condition helpers for consumer resources |
| internal/controller/indexer/indexer.go | Added indexer for consumer gateway reference |
| internal/controller/consumer_controller.go | Updated consumer controller with indexing, reconciliation, and secret processing |
| config/crd/bases/gateway.apisix.io_pluginconfigs.yaml | Minor CRD adjustments |
| config/crd/bases/gateway.apisix.io_consumers.yaml | Updated CRD defaults and validation for Consumer resources |
| api/adc/types.go | Updated consumer type definitions and name composition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for translating Consumer resources in the ADC provider and adds corresponding end-to-end tests. Key changes include:
- Adding new e2e test cases and scaffold functions for Consumer resources.
- Implementing consumer translation logic including credentials handling in the ADC translator.
- Updating CRD definitions, indexers, and controllers to support Consumer resource reconciliation.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/scaffold/k8s.go | Added ResourceApplied helper for resource creation and status check. |
| test/e2e/e2e_test.go | Updated imports to include new CRDs for consumers. |
| test/e2e/crds/consumer.go | Added comprehensive e2e tests for Consumer plugins and credentials. |
| internal/provider/provider.go | Extended TranslateContext with Credentials field. |
| internal/provider/adc/translator/translator.go | Introduced Consumers field in the translation result. |
| internal/provider/adc/translator/httproute.go | Added nil-check before unmarshalling plugin config data. |
| internal/provider/adc/translator/consumer.go | Implemented translation logic for Consumer resources. |
| internal/provider/adc/adc.go | Updated ADC update and delete flow to include Consumer resources. |
| internal/controller/status.go | Introduced status helper functions for consumer status conditions. |
| internal/controller/indexer/indexer.go | Added Consumer indexer using a new ConsumerGatewayRef field. |
| internal/controller/consumer_controller.go | Updated reconciliation for Consumer resources including secret fetching and status update. |
| config/crd/bases/gateway.apisix.io_consumers.yaml | Updated CRD definitions with defaults and validation for gatewayRef. |
| api/v1alpha1/consumer_types.go | Made gatewayRef.Name required and added default values for Kind and Group. |
| api/adc/types.go | Updated Consumer type and added ComposeConsumerName helper function. |
Comments suppressed due to low confidence (1)
test/e2e/crds/consumer.go:223
- The variable name 'updateCrendential' appears to be misspelled. Consider renaming it to 'updateCredential' for clarity.
var updateCrendential = `apiVersion: gateway.apisix.io/v1alpha1

Type of change:
What this PR does / why we need it:
#76 Part2
todo:
Pre-submission checklist: